<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hz.control.ActTypeControl"%>
<%@page import="com.hz.model.ActType"%>
<%@page import="com.hz.model.ParamDepartment"%>
<%@page import="com.hz.control.ParamDepartmentManager"%>
<!DOCTYPE HTML>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../../../css/active.css"/>
    <script type="text/javascript" src="../../../js/core.js"></script>
    <title>记录活动</title>
  </head>
   <link href="../../../resources/register/css/formitem.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../../resources/register/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="../../../resources/register/jquery.form-1.0.1.js"></script>
	<script type="text/javascript" src="../../../resources/register/jquery.form.valid-1.0.1.js"></script>
    <script type="text/javascript" src="../../common/js/WebCalendar.js"></script>
  <script type="text/javascript">
		$(function(){//跟顺序有关！按照form里面显示顺序排
			$("#actName").feikong();
			$("#actType").commonSelect();
			$("#peopleNum").feikong();
			$("#place").feikong();
			$("#cost").money();
			$("#leader").feikong();
			//$("#contact").mobile();
			//$("#Text3").feikong();
			//
			$("#htmlsave").htmlform();
			$("#ajaxsave").ajaxform();
			$("form").find("input[type!='radio'][type!='checkbox'][type!='button'][type!='submit'][type!='reset']").each(function(){
				$(this).addClass("form_item_input");
			});
		});
	</script>
  <body>
  
  <h1 class='title'>记录活动</h1>
  <form action="activity_add_2.jsp" method="post" name="form" id="testform">
  <table class='init'>
  <tr><th class='w280' ><label class="form-item-title">活动名称</label></th><td ><input class='w225' type="text" name="actName" id="actName" valid="feikong" required="true"/></td></tr>
  <tr><th><label class="form-item-title">活动类型</label></th><td><select class='w225' name="actType"id="actType" valid='commonSelect'  required="true" >
  <%
       Collection<ActType> atps = ActTypeControl.getAllActTypes();
       Iterator<ActType> it = atps.iterator();
       while(it.hasNext()){
       ActType at =  it.next();
   %>
   <option value="<%=at.getId() %>"><%=at.getTypeName() %></option>
   <%} %>
  </select></td></tr>
  <tr><th><label class="form-item-title">活动人数</label></th><td><input class='w225' type="text" id="peopleNum"name="peopleNum" onkeyup="value=value.replace(/[^\d]/g,'')"/></td></tr>
  
  <tr><th><label class="form-item-title">开始时间</label></th><td><input class='w225' type="text" name="startTime" maxlength="100"  onclick="SelectDate(this,'yyyy-MM-dd hh:mm')" readonly  style="width:265px;cursor:pointer"/></td></tr>
  <tr><th><label class="form-item-title">结束时间</label></th><td><input class='w225' type="text" name="endTime" maxlength="100"   onclick="SelectDate(this,'yyyy-MM-dd hh:mm')" readonly  style="width:265px;cursor:pointer"/></td></tr>
  <tr><th><label class="form-item-title">活动地点</label></th><td><input class='w225' type="text" name="place" id="place" valid="feikong"/></td></tr>
  
  <tr><th><label class="form-item-title">活动花费</label></th><td><input class='w225' type="text" name="cost" id="cost" valid="money"/>元</td></tr>
  <tr><th><label class="form-item-title">花费明细</label></th><td><textarea class='w225' name="costDetail" /></textarea></td>
  <tr><th><label class="form-item-title">所用资源</label></th><td><input class='w225' type="text" name="resource"/></td></tr>
  
  <tr><th><label class="form-item-title">负责人</label></th><td><input class='w225' type="text" name="leader" id="leader"valid="feikong" required="true"/></td></tr>
   <tr><th><label class="form-item-title">举办学院</label></th><td><select class='w225' name="departmentId" id="departmentId">
<option value="0">-选择学院-</option>
<% 
    ArrayList<ParamDepartment> pd = ParamDepartmentManager.getAllDepartment(0);
    for(int i=0;i<pd.size();i++){
        ParamDepartment p = pd.get(i);  
 %>
<option value="<%=p.getId() %>"><%=p.getDepartmentName() %></option>
<%} %>
</select></td></tr>
  </table>
  <p style='text-align: center; margin-top:15px;'><input type="button" id="htmlsave" value="继添加详细内容"/>&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="重置" /></p>
  </form>
  </body>
</html>
